function getTime(num1, num2) {
    $.ajax({
                url: `${Url}/Wechat/Api/PeriodNewBP?IdentityNo=${theRequest.IdentityNo}&BeginTime=${num1}&EndTime=${num2}`,
                type: 'get',
                datatype: 'json',
                // data: responseData,
                async: false,
                headers: {
                    'Authorization': Authorization
                },
                success: function(res) {
                        //收缩压
                        var num6 = res.data.NewBPItems;
                        var LeftDiastolic = [];
                        var RightDiastolic = [];
                        var RightSystolic = [];
                        var LeftSystolic = [];
                        var CheckDate = [];
                        for (let key in num6) {
                            var con = num6[key]
                            LeftDiastolic.push(con.LeftDiastolic);
                            RightSystolic.push(con.RightSystolic);
                            RightDiastolic.push(con.RightDiastolic);
                            LeftSystolic.push(con.LeftSystolic);
                            CheckDate.push(con.CheckDate);
                        }

                        let teplhtml = `
            ${num6.map(item=>{
              return `<tr><td>${item.CheckDate}</td><td>左:${item.LeftSystolic}右:${item.RightSystolic}</td><td>左:${item.LeftDiastolic}右:${item.RightDiastolic}</td></td></tr>`
          }).join('')
      }
           `
            $('#tabletext').html(teplhtml);
            var startLength = 100 - (7 / CheckDate.length * 100);
            var myChart1 = echarts.init(document.getElementById('main1'));

            option1 = {
                title: {
                    text: '血压检测数据',
                    subtext: '收缩压参考值:90~140mmHg',
                    x: 'right',

                },
                grid: {


                    top: "30%",
                    right: "0%",
                    bottom: '20%',
                    //     width: "66%",
                    left: "10%",
                    //     containLabel: true,
                    //     height: "55%"
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    y: 'top',
                    data: ['左收缩压', '右收缩压'],

                },
                xAxis: {
                    data: CheckDate,
                    show:false,
                },
                yAxis: {
                    max: 180,
                    min: 60
                },
                series: [{
                    name: '左收缩压',
                    type: 'line',
                    data: LeftSystolic,
                    markLine: {
                        symbol: ['none', 'none'], //去掉箭头
                        itemStyle: {
                            normal: {
                                lineStyle: {
                                    type: 'dashed',
                                    color: { //设置渐变
                                        type: 'linear',
                                        // x: 0,
                                        y: 0,
                                        x2: 0,
                                        y2: 1,
                                        colorStops: [{
                                            offset: 0,
                                            color: 'red ' // 0% 处的颜色
                                        }, {
                                            offset: 1,
                                            color: 'red' // 100% 处的颜色
                                        }],
                                        global: false // 缺省为 false
                                    }
                                },
                            }
                        },
                        data: [{
                            yAxis: 90,
                        }, {
                            yAxis: 140,
                        }]
                    },

                }, {
                    name: '右收缩压',
                    type: 'line',
                    data: RightSystolic,
                }],
                color: ['#3366CC', '#FFCC99'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'line'
                    }
                },

            };
            myChart1.setOption(option1);

            //舒张压
            var myChart2 = echarts.init(document.getElementById('main2'));
            option2 = {
                title: {
                    text: '血压检测数据',
                    subtext: '舒张压参考值:60~90mmHg',
                    x: 'right',

                },
                grid: {


                    top: "30%",
                    right: "0%",
                    bottom: '20%',
                    //     width: "66%",
                    left: "10%",
                    //     containLabel: true,
                    //     height: "55%"
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    y: 'top',
                    data: ['左舒张压', '右舒张压'],

                },
                xAxis: {
                    data: CheckDate,
                    show:false,
                },
                yAxis: {
                    max: 140,
                    min: 40
                },
                series: [{
                    name: '左舒张压',
                    type: 'line',
                    data: LeftDiastolic,
                    markLine: {
                        symbol: ['none', 'none'], //去掉箭头
                        itemStyle: {
                            normal: {
                                lineStyle: {
                                    type: 'dashed',
                                    color: { //设置渐变
                                        type: 'linear',
                                        // x: 0,
                                        y: 0,
                                        x2: 0,
                                        y2: 1,
                                        colorStops: [{
                                            offset: 0,
                                            color: 'red ' // 0% 处的颜色
                                        }, {
                                            offset: 1,
                                            color: 'red' // 100% 处的颜色
                                        }],
                                        global: false // 缺省为 false
                                    }
                                },
                            }
                        },
                        data: [{
                            yAxis: 60,
                        }, {
                            yAxis: 90,
                        }]
                    },

                }, {

                    name: '右舒张压',
                    type: 'line',
                    data: RightDiastolic,
                }],
                color: ['#3366CC', '#FFCC99'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'line'
                    }
                },
                dataZoom: [ //滑动条
                    {
                        type: 'inside',
                        realtime: true,
                        start: startLength,
                        end: 100,
                        startValue: 0
                    }
                ],
            };
            myChart2.setOption(option2);


        }
    })
}
getTime(getPreMonth(), getNowMonth());